package com.shanyue.controller;

import com.alibaba.fastjson.JSONArray;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shanyue.pojo.ZhengRenRenZheng;
import com.shanyue.service.ZhengRenRenZhengService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/ZhengRenRenZhengController")
public class ZhengRenRenZhengController {
    @Autowired
    ZhengRenRenZhengService zhengRenRenZhengService;


    @RequestMapping("/queryList")
    public String toUrl(Model model){

        PageInfo<ZhengRenRenZheng> zhengRenRenZhengPageInfo = zhengRenRenZhengService.pageInfo(1, 5,0);

        model.addAttribute("pageCount",zhengRenRenZhengPageInfo.getTotal());
        model.addAttribute("pageNum","1");
        return "/supervise/zhengrenrenzheng";
    }

    @RequestMapping("/pageInfo")
    @ResponseBody
    public PageInfo<ZhengRenRenZheng> queryList(Integer pageNum){
        if (pageNum==null){
            pageNum=1;
        }
        PageInfo<ZhengRenRenZheng> zhengRenRenZhengPageInfo = zhengRenRenZhengService.pageInfo(pageNum, 5,0);

        return zhengRenRenZhengPageInfo;
    }



}
